home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / ltp_rportattrs.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  1KB  |  68 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16.  
  17. /*****************************************************************************/
  18.  
  19.  
  20. VOID
  21. LTP_SetPens(struct RastPort *rp,LONG apen,LONG bpen,LONG mode)
  22. {
  23.     if(V39)
  24.         SetABPenDrMd(rp,apen,bpen,mode);
  25.     else
  26.     {
  27.         if(apen != rp->FgPen)
  28.             SetAPen(rp,apen);
  29.  
  30.         if(bpen != rp->BgPen)
  31.             SetBPen(rp,bpen);
  32.  
  33.         if(mode != rp->DrawMode)
  34.             SetDrMd(rp,mode);
  35.     }
  36. }
  37.  
  38.  
  39. /*****************************************************************************/
  40.  
  41.  
  42. VOID
  43. LTP_SetAPen(struct RastPort *rp,LONG apen)
  44. {
  45.     ULONG pen;
  46.  
  47.     if(V39)
  48.         pen = GetAPen(rp);
  49.     else
  50.         pen = rp->FgPen;
  51.  
  52.     if(pen != apen)
  53.         SetAPen(rp,apen);
  54. }
  55.  
  56.  
  57. /*****************************************************************************/
  58.  
  59.  
  60. VOID
  61. LTP_SetFont(LayoutHandle *handle,struct TextFont *font)
  62. {
  63.     SetFont(&handle->RPort,font);
  64.  
  65.     if(handle->Window)
  66.         SetFont(handle->Window->RPort,font);
  67. }
  68.